﻿
@{
    ViewBag.Title = "LawDocumentPageList";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

@section css{
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Bussiness/css/jquery.step.css" rel="stylesheet" />
    <style>
        .bg-light th {
            font-weight: bolder;
            text-align: center;
        }
    </style>
}
<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a>施工作业</a>
            </li>
            <li class="crumb-trail">施工管理</li>
        </ol>
    </div>
</header>
<section id="content" class="animated fadeIn" ng-cloak ng-controller="ConstructionController" ng-init="SearchModel={};page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     PageName='@Request.CurrentExecutionFilePath.Substring(Request.CurrentExecutionFilePath.LastIndexOf("/") + 1)';
  Id='@(Request.QueryString["Id"].IsEmpty() ? "1" : Request.QueryString["Id"])';
  GetFireOperateTicketList(Id);
         AddModel={};
    ">
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
			</path>
		</svg>
            <div class="load-msg">正在加载</div>
        </div>
    </div>
    <form class="form-horizontal">
        <div class="panel panel-info" style="margin-top:10px;">
            <div class="panel-heading">
                <span class="panel-title">
                    <span class="glyphicons glyphicons-list"></span>动火票数量 总数：{{DataList.length}}
                </span>
                <div class="widget-menu pull-right mr10">
                    <div class="btn-group">
                        <a href="FireOperateTicketAdd?page={{page}}&Id={{Id}}" class="btn btn-xs btn-default light">
                            <i class="fa fa-plus"></i>添加动火票
                        </a>
                    </div>
                </div>
            </div>
            <div class="panel-body">
                <table class="table table-bordered">
                    <thead>
                        <tr class="bg-light">
                            <th style="width:2%;">序号</th>
                            <th style="width:2%;">动火票单号</th>
                            <th style="width:3%;">开始时间</th>
                            <th style="width:4%;">结束时间</th>
                            <th style="width:5%;">涉及作业</th>
                            <th style="width:3%;">动火等级</th>
                            <th style="width:5%;">地点</th>
                            <th style="width:5%;">现场监督人</th>
                            <th style="width:5%;">完成时间</th>
                            <th style="width:5%;">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-show="DataList.length==0 && !DataLoading">
                            <td colspan="12" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                        </tr>
                        <tr ng-repeat="x in DataList">
                            <td style="text-align:center;">
                                <span>{{$index+1}}</span>
                            </td>
                            <td style="text-align:center;" ng-bind="x.TicketNo"></td>
                            <td style="text-align:center;">{{x.ApproveStartTime|JSONDate:'yyyy-MM-dd HH:mm'}}</td>
                            <td style="text-align:center;">{{x.ApproveEndTime|JSONDate:'yyyy-MM-dd HH:mm'}}</td>
                            <td style="text-align:center;" ng-bind="x.TypeList + (x.OtherType==null?'':x.OtherType)"></td>
                            <td style="text-align:center;" ng-bind="x.LevelName"></td>
                            <td style="text-align:center;" ng-bind="x.Location"></td>
                            <td style="text-align:center;"><span ng-repeat="y in x.Firemen">{{y.Name}} </span></td>
                            <td style="text-align:center;">{{x.CompleteTime|JSONDate:'yyyy-MM-dd HH:mm'}}</td>
                            <th>
                                <a ng-click="PrintTicket(x.Id);" class="btn btn-primary btn-xs btn-label"><i class="fa fa-print"></i>打印动火票</a>
                                <a ng-click="ExportFireOperateCheckForm(x.Id);" class="btn btn-primary btn-xs btn-label"><i class="fa fa-print"></i>打印检查表</a>
                                <a ng-click="GetTicketId(AddModel,x.Id);GetFireTicketFile(x.Id);" onclick="ClearFile();" href="#NewFileModal" data-toggle="modal" class="btn btn-info btn-xs btn-label"><i class="fa fa-file"></i> 更新附件</a>
                                <a ng-click="DeleteFireOperateTicket(x.Id,Id);" class="btn btn-danger btn-xs btn-label"><i class="fa fa-trash"></i> 删除</a>
                            </th>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </form>
    <div class="modal fade" id="NewFileModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:985px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">上传文件</h2>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" role="form">
                        <div class="form-group">
                            <label for="inputStandard" class="col-lg-2 control-label">已上传文件</label>
                            <div class="col-lg-9">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <th style="width:5%">序号</th>
                                            <th style="width:30%">文件名称</th>
                                            <th style="width:10%">文件大小(kb)</th>
                                            <th style="width:10%">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr ng-show="TicketFileList.length==0">
                                            <td colspan="4" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                                        </tr>
                                        <tr ng-repeat="x in TicketFileList">
                                            <td ng-bind="$index+1"></td>
                                            <td ng-bind="x.FileName"></td>
                                            <td ng-bind="x.FileSize"></td>
                                            <td>
                                                <a href="../Download/DownloadFile?FileId={{x.FileId}}" class="btn btn-success btn-xs btn-label"><i class="fa fa-download"></i>下载</a>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputStandard" class="col-lg-2 control-label">完成时间</label>
                            <div class="col-lg-8">
                                <datepicker id="startTime" option="datetimeOption" format="L HH:mm" ng-model="AddModel.CompleteTime"></datepicker>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputStandard" class="col-lg-2 control-label">添加文件</label>
                            <div class="col-lg-8">
                                <input type="file" ngf-select ng-model="doc.Files" name="docfiles" id="docfiles" class="file" initialPreviewAsData="true" data-show-remove="true" data-show-preview="true" showCancel="true" data-show-upload="false" multiple>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="UploadFireOperateTicket(AddModel);">上传</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn_close2">关闭</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <div class="modal fade" id="AddModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:985px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">添加消防队伍人员</h2>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" role="form">
                        <div class="form-group">
                            <label class="col-lg-2 control-label">厂区：</label>
                            <div class="col-lg-3">
                                <select class="form-control" ng-model="AddModel.FactoryArea">
                                    <option value="" selected>请选择厂区</option>
                                    <option ng-repeat="x in FactoryList" value="{{x.Factory}}">{{x.Factory}}</option>
                                </select>
                            </div>
                            <label class="col-lg-2 control-label">职位：</label>
                            <div class="col-lg-3">
                                <input type="text" class="form-control" ng-model="AddModel.Title">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">姓名：</label>
                            <div class="col-lg-3">
                                <input type="text" class="form-control" ng-model="AddModel.Name">
                            </div>
                            <label class="col-lg-2 control-label">电话：</label>
                            <div class="col-lg-3">
                                <input type="text" class="form-control" ng-model="AddModel.Phone">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">工作任务：</label>
                            <div class="col-lg-8">
                                <textarea class="form-control" ng-model="AddModel.WorkTask" rows="5"></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">上传资质：</label>
                            <div class="col-lg-8" id="filecontrol">
                                <input type="file" ngf-select name="docfiles" id="docfiles" class="file" initialPreviewAsData="true" data-show-remove="true" data-show-preview="true" showCancel="false" data-show-upload="false" required>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn_close">关闭</button>
                    <button type="button" class="btn btn-primary" ng-click="AddFighter(AddModel,1);">提交</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
</section>

@section Js{
    <script src="~/Bussiness/js/libs/jquery.step.min.js"></script>
    <script src="~/bussiness/js/pg/Construction.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/bussiness/js/libs/moment.min.js"></script>
    <script src="~/bussiness/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/bussiness/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/bussiness/js/libs/angularjs-datepicker.js"></script>
    <script src="~/bussiness/js/libs/fileinput.js"></script>
    <script src="~/bussiness/js/libs/zh.js"></script>

    <script>
        $('#docfiles').fileinput({
            language: 'zh'
        });
        $(".selectpicker").selectpicker({
            noneSelectedText: "所有发布机构"
        });
        function ClearFile() {
            $('#docfiles').fileinput('clear');
        }
    </script>
}


